package com.terrynoya.fight.stateMachine.triggers
{
	import com.terrynoya.fight.char.Character;
	import com.terrynoya.fight.evaluation.Node;
	import com.terrynoya.fight.evaluation.ParseState;
	import com.terrynoya.fight.stateMachine.State;

	public class PrevStateNo
	{
		public function PrevStateNo()
		{
		}
		
		public static function eval(data:Object,node:Node):*
		{
			var chara:Character = Character(data);
			if(chara == null)
			{
				return 0;
			}
			var prevState:State = chara.stateManager.previouseState;
			if(prevState == null)
			{
				return 0;
			}
			return prevState.id;
		}
		
		public static function parse(state:ParseState):Node
		{
			return state.baseNode;
		}
	}
}